package game.entity.action;

import edu.monash.fit2099.engine.*;
import game.entity.actor.*;
import game.entity.behavior.WanderBehaviour;
import game.entity.item.Egg;
import game.util.LocationUtil;

import java.util.List;

public class BirthAction extends Action {
    @Override
    public String execute(Actor actor, GameMap map) {
        //放一个卵
        Location location = map.locationOf(actor);
        // location.addItem(new Egg(actor+" Egg",'e',true,actor.getClass(),10));
        Class target = null;
        Item egg = null;
        if(actor instanceof Stegosaur){
            egg = new Egg<Stegosaur>(actor+" Egg",'e',true,3);
        }
        if(actor instanceof Brachiosaur){
            egg = new Egg<Brachiosaur>(actor+" Egg",'e',true,3);
        }
        if(actor instanceof Allosaurs){
            egg = new Egg<Allosaurs>(actor+" Egg",'e',true,3);
        }

        location.addItem(egg);
        actor.setBehaviour(new WanderBehaviour());
        //散步
        new WanderBehaviour().getAction(actor,map).execute(actor,map);
        return actor + " birth an egg!";
    }

    @Override
    public String menuDescription(Actor actor) {
        return null;
    }
}
